﻿@model IEnumerable<DLM.Domain.Model.Order>
@using Webdiyer.WebControls.Mvc;
@{
    ViewBag.Title = "都来米-我的订单";
    Layout = "~/Views/Shared/_Master.cshtml";
}
<div class="main">
    <div class="main_tab_2">
        <div class="main_tab_2_up">
            <ul>
                <li class="current"><a href="#">订单列表</a></li>
            </ul>
        </div>
        <div class="main_tab_2_down">
            <div id="divOrders" class="box">
                <table class="tb zhifu">
                    <thead>
                        <tr>
                            <th>
                                订单号
                            </th>
                            <th>
                                支付宝交易号
                            </th>
                            <th>
                                订单状态
                            </th>
                            <th>
                                备注
                            </th>
                            <th>
                                充值
                            </th>
                            <th>
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr>
                                <td>
                                    @item.OrderNo
                                </td>
                                <td>
                                    @item.TradeNo
                                </td>
                                <td>
                                    @{
                            switch (item.TradeStatus)
                            {
                                case "WAIT_BUYER_PAY":
                                        @Html.Label("等待买家支付")
                                   break;
                                case "WAIT_SELLER_SEND_GOODS":
                                        @Html.Label("等待卖家发货")
                                   break;
                                case "WAIT_BUYER_CONFIRM_GOODS":
                                        @Html.Label("等待买家确认")
                                   break;
                                case "TRADE_FINISHED":
                                        @Html.Label("交易结束")
                                   break;

                                default:
                                   break;
                            }
                                    }
                                </td>
                                <td>
                                    @item.Body
                                </td>
                                <td>
                                    @item.Price
                                </td>
                                <td>
                                    @Html.ActionLink("订单详情", "Detail", new { orderNo = item.OrderNo })
                                </td>
                            </tr>
                        }
                    </tbody>
@*                    <tfoot>
                        <tr>
                            <td colspan="4">
                                最近交易 @Model.Count() 笔
                            </td>
                        </tr>
                    </tfoot>*@
                </table>
                <div class="paging">
                    @Ajax.Pager(Model as PagedList<DLM.Domain.Model.Order>, new PagerOptions
{
    PageIndexParameterName = "page",
    CurrentPagerItemWrapperFormatString = "<span class=\"current\">{0}</span>",
    //NumericPagerItemWrapperFormatString = "<a>{0}</a>",
    PrevPageText = "<",
    NextPageText = ">",
    ShowNumericPagerItems = true,
    ShowFirstLast = false,
    ShowPrevNext = true,
    CssClass = "scott",
    MorePageText = "...",
    SeparatorHtml = ""
},
                    new AjaxOptions { UpdateTargetId = "divOrders" }
    )
                </div>
            </div>
            <div class="box" style="display: none;">
                456</div>
        </div>
    </div>
</div>
<!--main-end-->
